package cn.miw.android.bdmp3.model;

import java.io.Serializable;

import com.thoughtworks.xstream.annotations.XStreamAlias;

@SuppressWarnings("serial")
@XStreamAlias("data")
public class BaiDuListItem implements Serializable {
	private String id;
	private String name;
	private int curPos = 0, fileLength = 100;

	public int getCurPos() {
		return curPos;
	}

	public void setCurPos(int curPos) {
		this.curPos = curPos;
	}

	public int getFileLength() {
		return fileLength;
	}

	public void setFileLength(int fileLength) {
		this.fileLength = fileLength;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getSong() {
		String t=this.name.replace("$$", "-");
		String[] x = t.split("-");
		return x.length > 0 ? x[0] : "";
	}

	public String getSinger() {
		String t = this.name.replace("$$", "-");
		String[] x = t.split("-");
		return x.length > 1 ? x[1] : "";
	}

	public String getAlbumnName() {
		String[] x = this.name.replace("$$", "-").split("-");
		String albumnName = x.length > 2 ? x[2] : "";
		return albumnName;
	}

	@Override
	public String toString() {
		return "BaiDuListItem [id=" + id + ", name=" + name + ", singer=" + getSinger() + ", songName=" + getSong() + ", albumnName="
				+ getAlbumnName() + "]";
	}

}